﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using WatiN.Core;
using WatiN.Sharepoint.Pages;
using System.Diagnostics;
using WatiN.Sharepoint;

namespace NUnit.WatiN
{
    [TestFixture]
    public class TeamsiteTests
    {
        [STAThread]
        [Test]
        public void AddDocument_OpenSharedDocumentsAndAddDocument_DocumentAdded()
        {
            // see http://watinandmore.blogspot.com/2009/03/custom-elements-and-controls-in-watin.html
            ElementFactory.RegisterElementType(typeof(TableHeaderCell));

            using (Browser browser = new IE())
            {
                AllItems allItemsPage = Navigator.Go<AllItems>(browser, "http://dev.workspace/docs/UI.Test.Teamsite/Shared%20Documents/Forms/AllItems.aspx");

                Assert.AreEqual(5, allItemsPage.List.Columns.Count());
                Assert.AreEqual("Type", allItemsPage.List.Columns[1].Title);
                Assert.AreEqual("Modified By", allItemsPage.List.Columns[4].Title);
            }
        }
    }
}
